package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.PageAuthDto;
import com.heima.user.service.ApUserRealNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shiminghui
 * @date 2024/12/18 20:40
 * @description: TODO
 */
@RestController
@RequestMapping("/api/v1/auth")
public class ApUserAuthController {
    @Autowired
    private ApUserRealNameService apUserRealNameService;

    /**
     * 分页查询
     *
     * @param dto
     * @return
     */
    @PostMapping("list")
    public ResponseResult list(@RequestBody PageAuthDto dto) {
        ResponseResult result = apUserRealNameService.list(dto);
        return result;
    }

    /**
     * 审核失败
     *
     * @param dto
     * @return
     */
    @PostMapping("authFail")
    public ResponseResult authFail(@RequestBody PageAuthDto dto) {
        dto.setStatus(2);
        ResponseResult result = apUserRealNameService.auth(dto);
        return result;
    }

    /**
     * 审核通过
     *
     * @param dto
     * @return
     */
    @PostMapping("authPass")
    public ResponseResult authPass(@RequestBody PageAuthDto dto) {
        dto.setStatus(9);
        ResponseResult result = apUserRealNameService.auth(dto);
        return null;
    }

}
